package chapter02

import chapter01.Student

object Demo06_DateType {
  def main(args: Array[String]): Unit = {
    val c1: Char = 'a'
    println(c1)

    val c2: Char = '9'
    println(c2)
    //字符变量底层保存的是对应的ASCII码
    val i1: Int = c1
    println("i1:" + i1)  //i1:97
    val i2: Int = c2
    println("i2:" + i2)  //i2:57

    //特殊字符
    val c3: Char = '\t' //制表符
    val c4: Char = '\n' //换行符
    println("abc" + c3 + "def")
    println("abc" + c4 + "def")

    //转义字符
    val c5 = '\\' //表示\自己
    val c6 = '\"' //表示”
    println("abc" + c5 + "def")  //abc\def
    println("abc" + c6 + "def")  //abc"def

    //boolean 类型
    val isTrue: Boolean = true
    println(isTrue)  //true


    //空值
    //1、Unit
    def m1(): Unit = {
      println("m1 is used")
    }

    val a: Unit = m1()
    println(a)

    //2、空引用 Null
    var student: Student = new Student("bob" , 99)
    student = null
    println(student)
  }

  //3、Nothing

}
